﻿using Microsoft.SemanticKernel;
using System.ComponentModel;
using System.Text.Json.Serialization;

namespace Mozhi.Agent.DeepSeek.Plugins
{
    public class ProductPlugin
    {
        private readonly List<Product> products = new()
        {
            new Product { Id = Guid.Parse("482565ec-8e27-fa3b-04a9-a0295e898a88"), Name = "哇哈哈", Price = 5.69M },
            new Product { Id = Guid.Parse("edf50f80-e02c-ab4d-1628-c88f5f2bbfab"), Name = "旺仔牛奶", Price = 3.50M },
        };

        [KernelFunction("get_products")]
        [Description("Gets a list of products and their price")]
        public async Task<List<Product>> GetProductsAsync()
        {
            return products;
        }
    }

    public class Product
    {
        [JsonPropertyName("id")]
        public Guid Id { get; set; }

        [JsonPropertyName("name")]
        public string Name { get; set; }

        [JsonPropertyName("price")]
        public decimal Price { get; set; }
    }
}
